Data processing method, data processing apparatus, and program recording medium

ABSTRACT

When inputting moving image data into a personal computer for display or for recording on a recording medium, there often occur cases where processing cannot catch up with the input, resulting in interruption of the processing. Also, when performing conversion from an input digital signal having an arbitrary number of samples to an output digital signal having an arbitrary number of samples, prior art methods entail the possibility that the memory capacity and the amount of computation may become enormous. In view of this, according to the present invention, if the image processing cannot catch up with the input, the data is re-input for processing by utilizing information concerning the recorded position, the recorded time, or the time at which playback is to be performed; this achieves the same effect as processing continuous moving image data without interruption.

TECHNICAL FIELD

[0001] The present invention relates to a method and apparatus for taking, for example, moving image data as an input for playback on a TV monitor or for recording on a recording medium, and further relates to a method and apparatus for performing frequency conversion on image data, audio data, etc.

BACKGROUND ART

[0002] With increasing performance of personal computers, there has arisen a need to handle moving images such as TV signals on personal computers. When handling moving images on a personal computer, an apparatus such as a digital VTR for inputting moving images to the personal computer is connected, and moving image data prerecorded on a video tape or the like is input to the personal computer via the apparatus. The input moving image data is processed in various ways such as display on the screen of the personal computer and recording on a hard disk.

[0003] On the other hand, when playing back moving image data with audio on a personal computer, sample data conversion for converting the frequency of video and audio of digital format may become necessary because of the constraints of the hardware constituting the personal computer and other software.

[0004] In the prior art, when performing sample rate conversion, it is common practice to first upsample the input digital data and then apply low-pass filtering to decimate the data according to the output sample rate.

[0005] A sample data conversion method according to the prior art will be described below with reference to FIG. 17.

[0006]FIG. 17 is a diagram for explaining one example of sample data conversion according to the prior art.

[0007] The example of FIG. 17 shows sample data sequence conversion in the case where an input sample data sequence X[i] consisting of 400 samples is converted into an output sample data sequence Y[j] consisting of 300 samples. In this example, data X[i] represents, for example, the actual pixel value of the input image before the conversion, while Y[j] represents the pixel value of the output image after the conversion. In this case, i and j are variables each corresponding to the position coordinates of a pixel in the horizontal direction on a line in a frame.

[0008] First, a data sequence Z[k] upsampled from the input sample data sequence X[i] is obtained. When performing the upsampling, interpolation must be applied to the input sample data sequence X[i] so that all sample values Y[j] in the output sample data sequence Y[j] after the conversion will be contained in the data sequence Z[k]. Accordingly, the number of samples in the upsampled data sequence Z [k] is the least common multiple of the number of samples in the input sample data sequence X[i] and the number of samples in the output sample data sequence Y[j]. That is, it is the least common multiple of the number of samples before the conversion and the number of samples after the conversion. In the illustrated example, the number of samples in the upsampled data sequence Z[k] is 1,200 which is the least common multiple of 400 and 300.

[0009] Then, after low-pass filtering the upsampled data sequence Z[k] to eliminate distortion due to aliasing, unnecessary samples are decimated to obtain the output sample data sequence Y[j]. In the example of FIG. 17, the output sample data sequence Y[j] can be obtained by selecting, for example, a first sample in the upsampled data sequence Z[k], and then selecting every fourth sample from the first sample.

[0010] The above-described method is disclosed, for example, in Japanese Laid-open Patent No. 10-164468.

[0011] In the above method, when obtaining each sample in the upsampled data sequence Z[k], there frequently occur calculations for obtaining the value of a sample between two adjacent samples X[i] and X[i+1] in the input sample data sequence X[i] by weighted averaging based on the ratio between the distance from X[i] and the distance from X[i+1], i.e., (1−w):w (0≦w≦1). When obtaining a number AX existing at a designated position between two numbers A1 and A2 by using the ratio of the distances from A1 and A2 as described above, if the following (equation 12) holds, the value of the number AX is expressed by (equation 13) shown below.

(Distance between numbers A1 and AX):(Distance between numbers AX and A2)=(1−w):w  (Equation 12)

[0012] where 0≦w≦1

AX=w×A1+(1−w)×A2  (Equation 13)

[0013] When obtaining a number AX lying between two adjacent numbers A1 and A2 by a computer as described above, the method based on the flow chart of FIG. 18 is usually employed.

[0014] In FIG. 18, 1801 is a first load step, 1802 is a second load step, 1803 is a third load step, 1804 is a fourth load step, 1805 is a first multiplication step, 1806 is a subtraction step, 1807 is a second multiplication step, 1808 is an addition step, and 1809 is an output step.

[0015] The operation of the flow chart of FIG. 18 will be described below.

[0016] The two input sample values A1 and A2 and parameter w are loaded into a register A, a register B, and a register C in the first load step 1801, the second load step 1802, and the third load step 1803, respectively, and a numeric value 1 is loaded into a register D in the fourth load step 1804.

[0017] Next, in the first multiplication step 1805, the contents of the register A is multiplied by the contents of the register C. After the multiplication, (w×A1) is held in the register A.

[0018] In the subtraction step 1806, the contents of the register C is subtracted from the contents of the register D. After the subtraction, (1−w) is held in the register D.

[0019] In the second multiplication step 1807, the contents of the register B is multiplied by the contents of the register D. After the multiplication, (1−w)×A2 is held in the register B.

[0020] In the addition step 1808, the contents of the register B is added to the contents of the register A. After the addition, (w×A1+(1−w)×A2) is held in the register A.

[0021] Finally, in the output step 1809, AX, that is, (w×A1+(1−w)×A2), is output.

[0022] In this example, the operations necessary to obtain one number AX are four load operations, two multiplication operations, a subtraction, and an addition.

[0023] With recent advances in computer technology, it has become possible to accomplish the above-described sample data conversion at relatively high speed not only by dedicated hardware but also by personal computers (PCs).

[0024] However, in the above prior art which is directed to the processing of moving image data that does not have a real time requirement, the following problem occurs (1) if the PC does not have sufficient performance for handling moving images or, (2) even if the PC has sufficient performance as mentioned above, when interrupt processing occurs during moving image processing, though in the latter case there will be no problem when the PC processes only moving image data.

[0025] That is, since the amount of moving image data is very large, there can occur cases where the processing of the input moving image data for playback or for recording on a recording medium such as a hard disk cannot be completed in time, and in such cases, processing of part of the data has had to be given up. This has lead to the problem that when recording moving images on a hard disk, part of a scene is dropped or the recording of image data itself is stopped.

[0026] Furthermore, in the sample number conversion of the above-mentioned prior art, when performing the upsampling, data must be interpolated so that all samples after the conversion will be contained.

[0027] As a result, the number of samples in the upsampled data sequence is the least common multiple of the number of samples before the conversion and the number of samples after the conversion.

[0028] However, even when the number of samples before the conversion, M, and the number of samples after the conversion, N, are both small, if M and N are natural numbers relatively prime to each other, the number of samples in the upsampled data sequence is M×N, which can become a large number depending on the case. In that case, a memory having a very large capacity is needed in order to hold the upsampled data sequence.

[0029] Furthermore, in that case, the upsampling requires an enormous number of multiplications and subtractions, which means that an enormous amount of computation is required to accomplish the upsampling. This also means an enormous amount of computation for decimation including low-pass filtering.

[0030] Since such an enormous amount of computation becomes necessary, an enormous amount of time for computation is required. This can become a fatal shortcoming in processing video signals or audio signals when real time processing is required.

DISCLOSURE OF THE INVENTION

[0031] It is an object of the present invention to provide a data processing method and a data processing apparatus that can reduce data dropping, compared with the prior art, during playback or recording of moving image data when moving images prerecorded on a recording medium or the like and having no real time requirement are input to a conventional personal computer for processing.

[0032] Further, as described above, the prior art has had the problem that a large capacity memory and an enormous amount of computation are required when converting an input digital signal consisting of an arbitrary number of samples into an output digital signal consisting of an arbitrary number of samples that is different from the number of samples in the input digital signal; in view of this problem, it is another object of the present invention to provide a data processing method and a data processing apparatus that can accomplish the conversion with a small memory capacity and a small amount of computation when converting an input digital signal consisting of an arbitrary number of samples into an output digital signal consisting of an arbitrary number of samples that is different from the number of samples forming the input digital signal.

[0033] A 1st invention of the present invention is a data processing method for processing moving image data by reading and inputting said moving image data from another recording medium, comprising:

[0034] a moving image input step for inputting said moving image data for each prescribed unit;

[0035] a position information input step for inputting information concerning a position at which said prescribed unit of moving image data is recorded on said recording medium;

[0036] a moving image processing step for processing said moving image for each said prescribed unit;

[0037] a discontinuity point storing step for storing position information concerning a location of the processing unit of last moving image data that has successfully been processed without interruption, or a position preceding said location, as a discontinuity point when there occurs moving image data that cannot be processed in said moving image processing step;

[0038] a re-input step for rereading and re-inputting previously readout moving image data and position information by controlling said recording medium; and

[0039] a processing resuming step for detecting position information that matches the position information of said discontinuity point from among the position information input in said re-input step, and for resuming said moving image processing by using said detected position information.

[0040] A 2nd invention of the present invention is a data processing apparatus for processing moving image data by reading and inputting said moving image data from another recording medium, comprising:

[0041] moving image input means for inputting said moving image data for each prescribed unit;

[0042] position information input means for inputting information concerning a position at which said prescribed unit of moving image data is recorded on said recording medium;

[0043] moving image processing means for processing said moving image for each said prescribed unit;

[0044] discontinuity point storing means for storing position information concerning a location of the processing unit of last moving image data that has successfully been processed without interruption, or a position preceding said location, as a discontinuity point when there occurs moving image data that cannot be processed by said moving image processing means;

[0045] re-input means for rereading and re-inputting previously readout moving image data and position information by controlling said recording medium; and

[0046] processing resuming means for detecting position information that matches the position information of said discontinuity point from among the position information input by said re-input means, and for resuming said moving image processing by using said detected position information.

[0047] A 3rd invention of the present invention is a data processing method according to said 1st invention, wherein said another recording medium is a video tape, and

[0048] said information concerning said position is information concerning a record time counted from a prescribed position on said video tape.

[0049] A 4th invention of the present invention is a data processing apparatus according to said 2nd invention, wherein said another recording medium is a video tape, and

[0050] said information concerning said position is information concerning a record time counted from a prescribed position on said video tape.

[0051] A 5th invention of the present invention is a data processing method for processing moving image data by reading and inputting said moving image data from another recording medium, comprising:

[0052] a moving image input step for inputting said moving image data for each prescribed unit;

[0053] a recorded time information input step for inputting information concerning time at which said prescribed unit of moving image data was recorded on said recording medium;

[0054] a moving image processing step for processing said moving image for each said prescribed unit;

[0055] a discontinuity point storing step for storing recorded time information concerning a location of the processing unit of last moving image data that has successfully been processed without interruption, or a position preceding said location, as a discontinuity point when there occurs moving image data that cannot be processed in said moving image processing step;

[0056] a re-input step for rereading and re-inputting previously readout moving image data and recorded time information by controlling said recording medium; and

[0057] a processing resuming step for detecting recorded time information that matches the recorded time information of said discontinuity point from among the recorded time information input in said re-input step, and for resuming said moving image processing by using said detected recorded time information.

[0058] A 6th invention of the present invention is a data processing apparatus for processing moving image data by reading and inputting said moving image data from another recording medium, comprising:

[0059] moving image input means for inputting said moving image data for each prescribed unit;

[0060] recorded time information input means for inputting information concerning the time at which said prescribed unit of moving image data was recorded on said recording medium;

[0061] moving image processing means for processing said moving image for each said prescribed unit;

[0062] discontinuity point storing means for storing recorded time information concerning a location of the processing unit of last moving image data that has successfully been processed without interruption, or a position preceding said location, as a discontinuity point when there occurs moving image data that cannot be processed by said moving image processing means;

[0063] re-input means for rereading and re-inputting previously readout moving image data and recorded time information by controlling said recording medium; and

[0064] processing resuming means for detecting recorded time information that matches the recorded time information of said discontinuity point from among the recorded time information input by said re-input means, and for resuming said moving image processing by using said detected recorded time information.

[0065] A 7th invention of the present invention is a data processing method for inputting and processing moving image data, comprising:

[0066] a moving image input step for inputting said moving image data for each prescribed unit;

[0067] a playback time information input step for inputting information concerning time at which said moving image data is to be played back for each said prescribed unit;

[0068] a moving image processing step for processing said moving image for each said prescribed unit;

[0069] a discontinuity point storing step for storing playback time information concerning the location of the processing unit of last moving image data that has successfully been processed without interruption, or a position preceding said location, as a discontinuity point when there occurs moving image data that cannot be processed in said moving image processing step;

[0070] a re-input step for re-inputting said moving image data and said playback time information; and

[0071] a processing resuming step for detecting playback time information that matches the playback time information of said discontinuity point from among the playback time information input in said re-input step, and for resuming said moving image processing by using said detected playback time information.

[0072] An 8th invention of the present invention is a data processing apparatus for inputting and processing moving image data, comprising:

[0073] moving image input means for inputting said moving image data for each prescribed unit;

[0074] playback time information input means for inputting information concerning time at which said moving image data is to be played back for each said prescribed unit;

[0075] moving image processing means for processing said moving image for each said prescribed unit;

[0076] discontinuity point storing means for storing playback time information concerning the location of the processing unit of last moving image data that has successfully been processed without interruption, or a position preceding said location, as a discontinuity point when there occurs moving image data that cannot be processed by said moving image processing means;

[0077] re-input means for re-inputting said moving image data and said playback time information; and

[0078] processing resuming means for detecting playback time information that matches the playback time information of said discontinuity point from among the playback time information input by said re-input means, and for resuming said moving image processing by using said detected playback time information.

[0079] A 9th invention of the present invention is a data processing method according to said 1st, 5th, or 7th invention, wherein when performing said moving image processing by temporarily storing said moving image data in a buffer, said discontinuity point storing step detects a condition in which new moving image data is input into an area of said buffer, the processing of moving image data in said area is not yet finished.

[0080] A 10th invention of the present invention is a data processing apparatus according to said 2nd, 6th, or 8th invention, wherein when performing said moving image processing by temporarily storing said moving image data in a buffer, said discontinuity point storing means detects a condition in which new moving image data is input into an area of said buffer, the processing of moving image data in said area is not yet finished.

[0081] An 11th invention of the present invention is a data processing method according to said 1st, 5th, or 7th invention, wherein said another recording medium is a video tape, and

[0082] in said re-input step, when performing said moving image data playing back, said moving image data is played back once again after rewinding said video tape to a desired playback position.

[0083] A 12th invention of the present invention is a data processing apparatus according to said 2nd, 6th, or 8th invention, wherein said another recording medium is a video tape, and

[0084] when performing said moving image data playing back, said re-input means plays back said moving image data once again after rewinding said video tape to a desired playback position.

[0085] A 13th invention of the present invention is a data processing method for taking as an input a moving image consisting of N input frames per prescribed time, and for processing M frames per said prescribed time, comprising:

[0086] a register value initializing step for setting an initial value in a designated register;

[0087] a register value addition step for adding a constant m (where m=M or m=−M) to said register value when said input frame is input; and

[0088] an input frame processing step for (1) subtracting N from said register value and processing said input frame when said register value is not smaller than a prescribed value T as a result of said register value addition step in the case of said constant m=M, or (2) adding N to said register value and processing said input frame when said register value is not larger than said prescribed value T as a result of said register value addition step in the case of said constant m=−M.

[0089] A 14th invention of the present invention is a data processing apparatus for taking as an input a moving image consisting of N input frames per prescribed time, and for processing M frames per said prescribed time, comprising:

[0090] register value initializing means for setting an initial value in a designated register;

[0091] register value adding means for adding a constant m (where m=M or m=−M) to said register value when said input frame is input; and

[0092] input frame processing means for (1) subtracting N from said register value and processing said input frame when said register value is not smaller than a prescribed value T as a result of the addition by said register value adding means in the case of said constant m=M, or (2) adding N to said register value and processing said input frame when said register value is not larger than said prescribed value T as a result of the addition by said register value adding means in the case of said constant m=−M.

[0093] A 15th invention of the present invention is a data processing method for taking as an input a moving image consisting of N input frames per prescribed time, and for processing M frames per said prescribed time, comprising:

[0094] a register value initializing step for setting an initial value not larger than N in a designated register;

[0095] a first frame processing step for processing first input frame when said first input frame is input;

[0096] a register value addition step for adding a constant m (where m=M or m=−M) to said register value when said input frame other than said first input frame is input; and

[0097] an input frame processing step for (1) subtracting N from said register value and processing said input frame when said register value is not smaller than a prescribed value T as a result of said register value addition step in the case of said constant m=M, or (2) adding N to said register value and processing said input frame when said register value is not larger than said prescribed value T as a result of said register value adding means [sic; step] in the case of said constant m=−M.

[0098] A 16th invention of the present invention is a data processing apparatus for taking as an input a moving image consisting of N input frames per prescribed time, and for processing M frames per said prescribed time, comprising:

[0099] register value initializing means for setting an initial value not larger than N in a designated register;

[0100] first frame processing means for processing first input frame when said first input frame is input;

[0101] register value adding means for adding a constant m (where m=M or m=−M) to said register value when said input frame other than said first input frame is input; and

[0102] input frame processing means for (1) subtracting N from said register value and processing said input frame when said register value is not smaller than a prescribed value T as a result of the addition by said register value adding means in the case of said constant m=M, or (2) adding N to said register value and processing said input frame when said register value is not larger than said prescribed value T as a result of the addition by said register value adding means in the case of said constant m=−M.

[0103] A 17th invention of the present invention is a data processing method for taking as an input a moving image consisting of N input frames per prescribed time, and for processing M frames per said prescribed time, comprising:

[0104] a number-of-processing-frames initializing step for setting an initial value M representing the number of M frames;

[0105] a register value initializing step for setting an initial value not larger than N in a designated register;

[0106] a register value addition step for adding a constant m (where m=M or m=−M) to said register value when said input frame is input;

[0107] an input frame processing step for (1) subtracting N from said register value and processing said input frame when said register value is not smaller than a prescribed value T as a result of said register value addition step in the case of said constant m=M, or (2) adding N to said register value and processing said input frame when said register value is not larger than said prescribed value T as a result of said register value addition step in the case of said constant m=−M; and

[0108] a number-of-processing-frames adjusting step for varying said number of processing frames, M, and said constant m in accordance with the degree of load in said input frame processing step.

[0109] An 18th invention of the present invention is a data processing apparatus for taking as an input a moving image consisting of N input frames per prescribed time, and for processing M frames per said prescribed time, comprising:

[0110] number-of-processing-frames initializing means for setting an initial value M representing the number of M frames;

[0111] register value initializing means for setting an initial value not larger than N in a designated register;

[0112] register value adding means for adding a constant m (where m=M or m=−M) to said register value when said input frame is input;

[0113] input frame processing means for (1) subtracting N from said register value and processing said input frame when said register value is not smaller than a prescribed value T as a result of the addition by said register value adding means in the case of said constant m=M, or (2) adding N to said register value and processing said input frame when said register value is not larger than said prescribed value T as a result of the addition by said register value adding means in the case of said constant m=−M; and

[0114] number-of-processing-frames adjusting means for varying said number of processing frames, M, and said constant m in accordance with the degree of load in said input frame processing means.

[0115] A 19th invention of the present invention is a data processing method according to said 13th, 15th, or 17th invention wherein in the case of said constant m=M, T=N or T=N+1 is set as said prescribed value T, while in the case of said constant m=−M, T=0 or T=−1 is set as said prescribed value T.

[0116] A 20th invention of the present invention is a data processing apparatus according to said 14th, 16th, or 18th invention wherein in the case of said constant m=M, T=N or T=N+1 is set as said prescribed value T, while in the case of said constant m=−M, T=0 or T=−1 is set as said prescribed value T.

[0117] A 21st invention of the present invention is a data processing method according to said 17th invention, wherein when performing moving image processing by temporarily storing moving image data in a buffer,

[0118] in said number-of-processing-frames adjusting step, (1) said number of processing frames is reduced when the amount of moving image data remaining unprocessed in said buffer shows a tendency to increase, and (2) said number of processing frames is increased when the amount of moving image data remaining unprocessed in said buffer shows a tendency to decrease.

[0119] A 22nd invention of the present invention is a data processing apparatus according to said 18th invention, wherein when performing moving image processing by temporarily storing moving image data in a buffer,

[0120] said number-of-processing-frames adjusting means (1) reduces said number of processing frames when the amount of moving image data remaining unprocessed in said buffer shows a tendency to increase, and (2) increases said number of processing frames when the amount of moving image data remaining unprocessed in said buffer shows a tendency to decrease.

[0121] A 23rd invention of the present invention is a data processing method according to said 17th invention, wherein when performing moving image processing by temporarily storing moving image data in a buffer, only moving image data to be actually processed is stored in said buffer.

[0122] A 24th invention of the present invention is a data processing apparatus according to said 18th invention, wherein when performing moving image processing by temporarily storing moving image data in a buffer, only moving image data to be actually processed is stored in said buffer.

[0123] A 25th invention of the present invention is a data processing method for converting an input sample data sequence consisting of M samples to an output sample data sequence consisting of N samples, comprising:

[0124] an initial value setting step for setting a nonzero constant k and a prescribed parameter W;

[0125] a sequential addition step for repeating an operation to add k*N to said parameter W by sequentially scanning input sample data as long as W≦0 when k>0 or as long as W≧0 when k<0;

[0126] a sample data output step for outputting said converted output sample data when W becomes larger than 0 in the case of k>0 or W becomes smaller than 0 in the case of k>0 in said sequential addition step; and

[0127] a subtraction step for subtracting k*M from said W, wherein said sequential addition step, said sample data output step, and said subtraction step are repeated until said N output sample data have been output.

[0128] A 26th invention of the present invention is a data processing method according to said 25th invention, wherein when each sample data in said output sample data sequence has a byte length represented by a prescribed constant b, and an overall byte length of said output sample data sequence is not an integral multiple of a prescribed constant p, there is further included a dummy adding step for adding dummy data of L−b*N bytes at end of said output sample data sequence of N samples, where L is a multiple of p not smaller than b*N, and said output sample data sequence of N samples is output together with said dummy data.

[0129] A 27th invention of the present invention is a data processing method according to said 25th invention, wherein said k is 1.

[0130] A 28th invention of the present invention is a data processing method according to said 25th invention, wherein said k is the reciprocal of the greatest common measure of said M and said N.

[0131] A 29th invention of the present invention is a data processing method comprising:

[0132] a data input step for inputting data of two predetermined numbers X1 and X2;

[0133] a parameter input step for inputting a parameter w for obtaining a number Y located at a position at which the distance between said X1 and said X2 is divided in a ratio of (1−w):w;

[0134] a subtraction step for generating X3 by subtracting said X2 from said X1;

[0135] a times w multiplying step for generating X4 by multiplying the X3 obtained in said subtraction step by said parameter w;

[0136] an addition step for generating Y by adding said X2 to the X4 obtained in said times w multiplying step; and

[0137] an output step for outputting said Y obtained in said addition step.

[0138] A 30th invention of the present invention is a data processing method for inputting N data sequences X[i] [sic; for inputting data sequence X[i] including N data], and for outputting as Y[i] a value obtained by dividing said X[i] by a constant Q, comprising:

[0139] an initializing step for obtaining a coefficient w=2{circumflex over ( )}k/Q (where {circumflex over ( )}k means raising to the power k) for an integer k larger than 0;

[0140] a times w multiplying step for obtaining w*X[i] using said X[i] and said coefficient w obtained in said initializing step, and for taking said obtained w*X[i] as a new X[i]; and

[0141] a bit shift step for taking as Y[i] a value obtained by shifting the X[i] obtained in said times w multiplying step by k bits in a low order bit direction when said X[i] is expressed in bit representation, wherein

[0142] said times w multiplying step and said bit shift step are repeated N times to sequentially output N data sequences Y[i] [sic; to sequentially output data sequence Y[i] including N data].

[0143] A 31st invention of the present invention is a data processing apparatus for converting an input sample data sequence consisting of M samples to an output sample data sequence consisting of N samples, comprising:

[0144] initial value setting means for setting a nonzero constant k and a prescribed parameter W;

[0145] sequential adding means for repeating an operation to add k*N to said parameter W by sequentially scanning input sample data as long as W≦0 when k>0 or as long as W≧0 when k<0;

[0146] sample data output means for outputting said converted output sample data when W becomes larger than 0 in the case of k>0 or W becomes smaller than 0 in the case of k<0 by said sequential adding means; and

[0147] subtracting means for subtracting k*M from said W, wherein

[0148] said sequential adding means, said sample data output means, and said subtracting means are operated in sequence repeatedly until said N output sample data have been output.

[0149] A 32nd invention of the present invention is a data processing apparatus according to said 31st invention, wherein when each sample data in said output sample data sequence has a byte length represented by a prescribed constant b, and an overall byte length of said output sample data sequence is not an integral multiple of a prescribed constant p, there is further included a dummy adding means for adding dummy data of L−b*N bytes at end of said output sample data sequence of N samples, where L is a multiple of p not smaller than b*N, and

[0150] said output sample data sequence of N samples is output together with said dummy data.

[0151] A 33rd invention of the present invention is a data processing apparatus according to said 31st invention, wherein said k is 1.

[0152] A 34th invention of the present invention is a data processing apparatus according to said 31st invention, wherein said k is the reciprocal of the greatest common measure of said M and said N.

[0153] A 35th invention of the present invention is a data processing apparatus comprising:

[0154] data input means for inputting data of two predetermined numbers X1 and X2;

[0155] parameter input means for inputting a parameter w for obtaining a number Y located at a position at which the distance between said X1 and said X2 is divided in a ratio of (1−w):w;

[0156] subtracting means for generating X3 by subtracting said X2 from said X1;

[0157] times w multiplying means for generating X4 by multiplying the X3 obtained by said subtracting means by said parameter w;

[0158] adding means for generating Y by adding said X2 to the X4 obtained by said times w multiplying means; and

[0159] output means for outputting said Y obtained by said adding means.

[0160] A 36th of the present invention is a data processing apparatus for inputting N data sequences X[i] [sic; for inputting data sequence X[i] including N data], and for outputting as Y[i] a value obtained by dividing said X[i] by a constant Q, comprising:

[0161] initializing means for obtaining a coefficient w=2{circumflex over ( )}k/Q (where {circumflex over ( )}k means raising to the power k) for an integer k larger than 0;

[0162] times w multiplying means for obtaining w*X[i] using said X[i] and said coefficient w obtained by said initializing means, and for taking said obtained w*X[i] as a new X[i]; and

[0163] bit shift means for taking as Y[i] a value obtained by shifting the X[i] obtained by said times w multiplying means by k bits in a low order bit direction when said X[i] is expressed in bit representation, wherein

[0164] said times w multiplying means and said bit shift means are operated in sequence N times to sequentially output N data sequences Y[i] [sic; to sequentially output data sequence Y[i] including N data].

[0165] A 37th invention of the present invention is a program recording medium having recorded thereon a program for enabling a computer to carry out all or part of operations in all or part of the steps of a data processing method as described in any one of said 1st, 3rd, 5th, 7th, 9th, 11th, 13th, 15th, 17th, 19th, 21st, 23rd, and 25th to 30th inventions.

[0166] A 38th invention of the present invention is a program recording medium having recorded thereon a program for enabling a computer to implement all or part of the functions of all or part of the means in a data processing apparatus as described in any one of said 2nd, 4th, 6th, 8th, 10th, 12th, 14th, 16th, 18th, 20th, 22nd, 24th, and 31st to 36th inventions.

BRIEF DESCRIPTION OF THE DRAWINGS

[0167]FIG. 1 is a block diagram showing a first embodiment of the present invention.

[0168]FIG. 2 is a block diagram showing a second embodiment of the present invention.

[0169]FIG. 3 is a block diagram showing a third embodiment of the present invention.

[0170]FIG. 4 is a block diagram showing a fourth embodiment of the present invention.

[0171]FIG. 5 is a block diagram showing a fifth embodiment of the present invention.

[0172]FIG. 6 is a block diagram showing a sixth embodiment of the present invention.

[0173]FIG. 7 is a block diagram showing seventh and eighth embodiments of the present invention.

[0174]FIG. 8 is a flow chart illustrating the operation of the seventh and eighth embodiments of the present invention.

[0175]FIG. 9 is an explanatory diagram for explaining in detail the operation of the seventh embodiment of the present invention.

[0176]FIG. 10 is an explanatory diagram for explaining in detail the operation of the eighth embodiment of the present invention.

[0177]FIG. 11 is a block diagram showing a ninth embodiment of the present invention.

[0178]FIG. 12 is a flow chart illustrating the operation of the ninth embodiment of the present invention.

[0179]FIG. 13 is a block diagram showing a 10th embodiment of the present invention.

[0180]FIG. 14 is a flow chart illustrating the operation of the 10th embodiment of the present invention.

[0181]FIG. 15 is a block diagram showing an 11th embodiment of the present invention.

[0182]FIG. 16 is a flow chart illustrating the operation of the 11th embodiment of the present invention.

[0183]FIG. 17 is a diagram illustrating one example of a sample data conversion according to the prior art.

[0184]FIG. 18 is a flow chart illustrating a method of calculation by weighted averaging two adjacent numbers according to the prior art.

DESCRIPTION OF REFERENCE NUMERALS

[0185]101. POSITION INFORMATION INPUT BLOCK

[0186]102. DISCONTINUITY POINT STORING BLOCK

[0187]103. RE-INPUT BLOCK

[0188]104. PROCESSING RESUMING BLOCK

[0189]105. MOVING IMAGE INPUT BLOCK

[0190]106. IMAGE STORAGE PROCESSING BLOCK

[0191]201. RECORDED TIME INFORMATION INPUT BLOCK

[0192]202. DISCONTINUITY POINT STORING BLOCK

[0193]301. PLAYBACK TIME INFORMATION INPUT BLOCK

[0194]302. DISCONTINUITY POINT STORING BLOCK

[0195]401. REGISTER VALUE INITIALIZING BLOCK

[0196]402. REGISTER

[0197]403. MOVING IMAGE INPUT BLOCK

[0198]404. REGISTER VALUE ADDING BLOCK

[0199]405. REGISTER VALUE SUBTRACTING BLOCK

[0200]406. IMAGE PROCESSING BLOCK

[0201]501. REGISTER VALUE INITIALIZING BLOCK

[0202]502. FIRST FRAME PROCESSING BLOCK

[0203]601. NUMBER-OF-PROCESSING-FRAMES INITIALIZING BLOCK

[0204]602. NUMBER-OF-PROCESSING-FRAMES ADJUSTING BLOCK

BEST MODE FOR CARRYING OUT THE INVENTION

[0205] Embodiments of the present invention will be described below with reference to drawings.

[0206] (Embodiment 1)

[0207]FIG. 1 is a block diagram showing the configuration of a data processing apparatus according to a first embodiment of the present invention.

[0208] In FIG. 1, reference numeral 101 is a position information input block, 102 is a discontinuity point storing block, 103 is a re-input block, 104 is a processing resuming block, 105 is a moving image input block, and 106 is an image storage processing block.

[0209] Next, the operation of this embodiment will be described along with a data processing method constituting one embodiment of the present invention.

[0210] The following description of this embodiment deals with processing in which moving image data recorded on a video tape recorder is played back and stored on a hard disk of a personal computer.

[0211] First, the moving image data played back on the video tape recorder and input via the moving image input block 105 is supplied to the image storage processing block 106. The image storage processing block 106 stores the input moving image data in the form of a file on the hard disk. Depending on the case, the input moving image can be presented for viewing on the display of the personal computer.

[0212] The moving image data output from the moving image input block 105 contains position information. This position information is supplied to the discontinuity point storing block 102 via the image storage processing block 106.

[0213] On the other hand, position information indicating the position at which the processing of the moving image data is to be started is supplied from the position information input block 101 to the discontinuity point storing block 102. The position information indicating the starting position may be specified by the user, or position information on the video tape first acquired after starting the processing may be used as the position information.

[0214] One example of the position information, in the case of home digital video tape recorders conforming to the DV standard, is the ATN (absolute track number) value, which is output as a digital playback output together with the moving image data.

[0215] The discontinuity point storing block 102 monitors the processing progressing in the image storage processing block 106 and, if, in the input moving image data, there is any data that failed to be processed in time, the position information corresponding to the last moving image data that has been processed normally is stored as a discontinuity point.

[0216] Usually, input moving image data is temporarily stored in a buffer first, and then subjected to image processing. It is therefore possible to detect that the data has failed to be processed in time by detecting new input moving image data having been written over a buffer area where the moving image data remaining unprocessed is held.

[0217] Here, the discontinuity point which serves as the position information corresponding to the last successfully processed moving image data must be set so as to indicate the location of the processing unit of the last moving image data that has successfully been processed, or a position preceding that location, by considering the following point.

[0218] That is, the discontinuity point is set at the location of the processing unit of the last moving image data that has successfully been processed, or at a position preceding that location, by considering the influences of the VTR tape speed and of the acceleration and deceleration of the tape reel as well as the fact that the accuracy for rewinding the tape to the position where the target ATN value is recorded depends on the acceleration and deceleration characteristics of the servo motor.

[0219] When such a discontinuity point occurs, the image processing is temporarily suspended, and the re-input block 103 causes the video tape recorder being played back to be rewound via the moving image input block 105 and restarts the moving image input.

[0220] The processing resuming block 104 compares the discontinuity point stored in the discontinuity point storing block 102 with the position information supplied via the image storage processing block 106 through the discontinuity point storing block 102 and re-input block 103. When both match as the result of the comparison, the processing resuming block 104 allows the image storage processing block 106 to process moving image data that is input temporally following the detection position of the position information that matched.

[0221] As described above, in the first embodiment of the present invention, if image processing has failed to be completed in time, the processing can be restarted by utilizing the information concerning the recording place (position) being played back on the video tape recorder.

[0222] More specifically, if the image processing is interrupted due to the occurrence of interrupt processing in the personal computer, since a chance is given to resume the image processing from the point preceding the point at which the image processing was interrupted, the correctly continuing image processing can be accomplished at the second try unless the interrupt processing occurs again. If the image processing is interrupted again, as similar to the above, re-processing is performed once again.

[0223] Generally, it has been difficult for a personal computer to handle moving image data continuing for a long time because handling moving images imposes a very large load on the personal computer. By contrast, in the present invention, if the processing is interrupted, since the processing can be resumed from the correct position once again, the eventually processed data (the data stored on the hard disk) is equivalent to data that would have been correctly processed continuously.

[0224] In the present embodiment, a position on the recorded tape is used as the position information, but it will be appreciated that the record time from a prescribed position on the tape can also be used as the information for specifying a position on the tape.

[0225] (Embodiment 2)

[0226]FIG. 2 is a block diagram showing the configuration of a data processing apparatus according to a second embodiment of the present invention.

[0227] In FIG. 2, reference numeral 201 is a recorded time information input block, 202 is a discontinuity point storing block, 103 is a re-input block, 104 is a processing resuming block, 105 is a moving image input block, and 106 is an image storage processing block.

[0228] Next, the operation of the embodiment of FIG. 2 will be described along with a data processing method constituting one embodiment of the present invention.

[0229] This embodiment uses recorded time information as an example of the position information described in the first embodiment, and the functions of the respective blocks are fundamentally the same as those in the foregoing embodiment. The recorded time information here refers to information concerning the time at which input moving image data was recorded.

[0230] First, the moving image data input via the moving image input block 105 is supplied to the image storage processing block 106. The image storage processing block 106 stores the input moving image data in the form of a file on the hard disk.

[0231] On the other hand, the recorded time information as the position information indicating the position at which the processing of the moving image data is to be started is input from the recorded time information input block 201 to the discontinuity point storing block 202.

[0232] In the case of home digital video tape recorders conforming to the DV standard, this recorded time information is called “RecTime”, and is output as a digital playback output together with the moving image data. The recorded time information is supplied to the discontinuity point storing block 202 via the image storage processing block 106, as in the foregoing embodiment.

[0233] The discontinuity point storing block 202 monitors the processing progressing in the image storage processing block 106 and, if, in the input moving image data, there is any data that failed to be processed in time, the recorded time information for the last moving image data that has been processed normally is stored as a discontinuity point.

[0234] When such a discontinuity point occurs, the image processing is temporarily suspended, and the re-input block 103 causes the video tape recorder being played back to be rewound via the moving image input block 105 and restarts the moving image input.

[0235] The processing resuming block 104 compares the discontinuity point stored in the discontinuity point storing block 202 with the recorded time information supplied via the image storage processing block 106 through the discontinuity point storing block 202 and re-input block 103, and when both match as the result of the comparison, the processing resuming block 104 allows the image storage processing block 106 to process moving image data that is input temporally following the detection position of the recorded time information that matched.

[0236] As described above, in the second embodiment of the present invention, if image processing has failed to be completed in time, the processing can be restarted by utilizing the information concerning the recorded time of the video tape recorder being played back, as in the foregoing embodiment.

[0237] (Embodiment 3)

[0238]FIG. 3 is a block diagram showing the configuration of a data processing apparatus according to a third embodiment of the present invention.

[0239] In FIG. 3, reference numeral 301 is a playback time information input block, 302 is a discontinuity point storing block, 103 is a re-input block, 104 is a processing resuming block, 105 is a moving image input block, and 106 is an image storage processing block.

[0240] Next, the operation of the embodiment of FIG. 3 will be described along with a data processing method constituting one embodiment of the present invention.

[0241] This embodiment uses playback time information as an example of the position information described in the first embodiment, and the functions of the respective blocks are fundamentally the same as those in the foregoing embodiment. The playback time information here refers to information concerning the time at which the input moving image data is to be played back.

[0242] First, the moving image data input via the moving image input block 105 is supplied to the image storage processing block 106. The image storage processing block 106 stores the input moving image data in the form of a file on the hard disk.

[0243] On the other hand, the playback time information, which serves as the position information indicating the position at which the processing of the moving image data is to be started, is input from the playback time information input block 301 to the discontinuity point storing block 302.

[0244] The playback time information is often appended to data, such as MPEG compressed moving image data, in which the order of transmit time and the order of playback time differ from one frame to the next. The playback time information is supplied to the discontinuity point storing block 302 via the image storage processing block 106, as in the foregoing embodiment.

[0245] The discontinuity point storing block 302 monitors the processing progressing in the image storage processing block 106 and, if, in the input moving image data, there is any data that failed to be processed in time, the playback time information for the last moving image data that has been processed normally is stored as a discontinuity point.

[0246] When such a discontinuity point occurs, the re-input block 103 causes the video tape recorder being played back to be rewound via the moving image input block 105 and restarts the moving image input.

[0247] The processing resuming block 104 compares the discontinuity point stored in the discontinuity point storing block 302 with the playback time information supplied via the image storage processing block 106 through the discontinuity point storing block 302 and re-input block 103. When both match as the result of the comparison, the processing resuming block 104 allows the image storage processing block 106 to process moving image data that is input temporally following the detection position of the playback time information that matched.

[0248] As described above, in the third embodiment of the present invention, if image processing has failed to be completed in time, the processing can be restarted by utilizing the moving image appended information concerning the time at which the data is to be played back.

[0249] (Embodiment 4)

[0250]FIG. 4 is a block diagram showing the configuration of a data processing apparatus according to a fourth embodiment of the present invention.

[0251] This embodiment is applied when there is a limit on the image processing capacity for moving image data or on the recording capacity of recording media on the data processing apparatus side because of hardware constraints of the data processing apparatus. That is, this embodiment differs from the foregoing embodiments in that even when the amount of input image data is so large as to exceed the limit, degradation of image quality can be alleviated compared with the prior art by suitably decimating the input image data.

[0252] In FIG. 4, reference numeral 401 is a register value initializing block, 402 is a register, 403 is a moving image input block, 404 is a register value adding block, 405 is a register value subtracting block, and 406 is an image processing block.

[0253] Next, the operation of the embodiment of FIG. 4 will be described along with a data processing method constituting one embodiment of the present invention.

[0254] Input frames to be processed in this embodiment include already decoded frames, or MPEG compressed image data consisting only of I pictures, or DV data (intraframe coded data) or the like.

[0255] Here, the number of moving image frames input per second is denoted by N and the number of frames to be processed is denoted by M, while constant m is set equal to M. Since m=M, T=N is selected as a prescribed value T.

[0256] First, the value of the register 402 is initialized at a certain point in time by the register value initializing block 401. Here, the initial value is set as 0.

[0257] Next, the moving image data input via the moving image input block 403 is supplied to the image processing block 406. At the same time, the register value adding block 404 adds m to the value of the register 402 each time one frame data is input.

[0258] The register value subtracting block 405 detects the register value thus incremented by the register value adding block 404 and, if the value is not smaller than T=N, then subtracts N from the register value and supplies a processing instruction to the image processing block 406.

[0259] For the input moving image data, the image processing block 406 performs processing only on the frame data for which the processing instruction is supplied from the register value subtracting block 405.

[0260] The operation of the fourth embodiment will be described by taking as an example the case of N=30 and m=M=23 to simplify the explanation.

[0261] Table 1 shows how the register value changes with each input frame under the above conditions. TABLE 1 Input Register Image frame Operation value processing — Register value  0 initialization 0 Register value 23 addition(+23) Register value 23 subtraction(no processing) 1 Register value 46 addition(+23) Register value 16 Processing subtraction(−30) of frame 1 2 Register value 39 addition(+23) Register value  9 Processing subtraction(−30) of frame 2 3 Register value 32 addition(+23) Register value  2 Processing subtraction(−30) of frame 3 4 Register value 25 addition(+23) Register value 25 subtraction(no processing) 5 Register value 48 addition(+23) Register value 18 Processing subtraction(−30) of frame 5

[0262] In Table 1, it is assumed that the time elapses from the top row toward the bottom row.

[0263] In Table 1, first the register value is set to 0 by register value initialization.

[0264] Next, for each input of a new frame, 23 is added to the register value by the register value adding operation, and if the result is 30 or larger, 30 is subtracted from the register value by the register value subtracting operation. Image processing is performed on the input frame for which the register value subtracting operation is performed.

[0265] With the above processing, image processing is performed in the order of frames 1, 2, 3, 5, . . .

[0266] As a result, of the 30 frames of moving image input per second, seven frames are dropped, and the remaining 23 frames of moving image are selected for image processing.

[0267] In such a case, since 30 and 23 are prime relative to each other, if 23 frames per second are to be selected from the 30 frames per second while minimizing image quality degradation, the prior art would involve repeating trial and error so that the frames to be dropped would not be contiguous as much as possible. Accordingly, each time the number N of input frames or the number M of frames to be processed changes, a suitable way of frame decimation has had to be determined through trial and error.

[0268] By contrast, according to the present embodiment, the same conversion method can be applied at all times, irrespective of the number N of input frames or the number M of frames to be processed. Furthermore, the conversion can be accomplished by a very simple method involving only addition and subtraction operations for each frame.

[0269] It will be recognized here that N, M(m), and T can be set to other desired values than the values used in this embodiment.

[0270] (Embodiment 5)

[0271]FIG. 5 is a block diagram showing the configuration of a data processing apparatus according to a fifth embodiment of the present invention.

[0272] In FIG. 5, reference numeral 501 is a register value initializing block, 402 is a register, 403 is a moving image input block, 404 is a register value adding block, 405 is a register value subtracting block, 406 is an image processing block, and 502 is a first frame processing block.

[0273] Next, the operation of the embodiment of FIG. 5 will be described along with a data processing method constituting one embodiment of the present invention.

[0274] Here, as in the foregoing fourth embodiment, the number of moving image frames input per second is denoted by N and the number of frames to be processed is denoted by M, while m is set equal to M and T is set equal to N.

[0275] First, the moving image data input via the moving image input block 403 is supplied to the image processing block 406.

[0276] When the first frame is input, the first frame processing block 502 initializes the value of the register 402 by using the register value initializing block 501, and supplies a processing instruction to the image processing block 406. Here, the initial value of the register is set to 0.

[0277] After that, the register value adding block 404 adds M to the value of the register 402 each time frame data is input, as in the foregoing fourth embodiment.

[0278] The register value subtracting block 405 detects the register value thus incremented by the register value adding block 404 and, if the value is not smaller than N, then subtracts N from the register value and supplies a processing instruction to the image processing block 406.

[0279] For the input moving image data, the image processing block 406 performs processing only on the frame data for which the processing instruction is supplied from the register value subtracting block 405.

[0280] The operation of the fifth embodiment will be described by taking as an example the case of N=30 and m=M=13 to simplify the explanation.

[0281] Table 2 shows how the register value changes with each input frame under the above conditions. TABLE 2 Input Register Image frame Operation value processing 0 Register value  0 initialization Processing of  0 Processing first frame of frame 0 1 Register value 13 addition(+13) Register value 13 subtraction(no processing) 2 Register value 26 addition(+13) Register value 26 subtraction(no processing) 3 Register value 39 addition(+13) Register value  9 Processing subtraction(−30) of frame 3 4 Register value 22 addition(+13) Register value 22 subtraction(no processing) 5 Register value 35 addition(+13) Register value  5 Processing subtraction(−30) of frame 5 6 Register value 18 addition(+13) Register value 18 subtraction(no processing)

[0282] In Table 2, it is assumed that the time elapses from the top row toward the bottom row.

[0283] In Table 2, when the first frame is input, the register value is set to 0 by register value initialization, and frame 0 is processed by the first frame processing.

[0284] Next, for each input of a new frame, 13 is added to the register value by the register value adding operation, and if the result is 30 or larger, 30 is subtracted from the register value by the register value subtracting operation. Image processing is performed on the input frame for which the register value subtracting operation is performed.

[0285] With the above processing, image processing is performed in the order of frames 0, 3, 5, . . .

[0286] As a result, of the 30 frames of moving image input per second, 17 frames are dropped, and the remaining 13 frames of moving image are selected for image processing.

[0287] In this way, in the fifth embodiment, the first input frame is always selected for image processing. Accordingly, even when the number of input frames is small, at least one frame is processed.

[0288] (Embodiment 6)

[0289]FIG. 6 is a block diagram showing the configuration of a data processing apparatus according to a sixth embodiment of the present invention.

[0290] In FIG. 6, reference numeral 401 is a register value initializing block, 402 is a register, 403 is a moving image input block, 404 is a register value adding block, 405 is a register value subtracting block, 406 is an image processing block, 601 is a number-of-processing-frames initializing block, and 602 is a number-of-processing-frames adjusting block.

[0291] The operation of the embodiment of FIG. 6 will be described along with a data processing method constituting one embodiment of the present invention.

[0292] Here, as in the foregoing fourth embodiment, the number of moving image frames input per second is denoted by N and the number of frames to be processed is denoted by M, while m is set equal to M and T is set equal to N.

[0293] First, the number-of-processing-frames initializing block 601 initializes the value M which is added by the register value adding block 404. Usually, N is set as M.

[0294] Next, the moving image data input via the moving image input block 403 is supplied to the image processing block 406. When the first frame is input, the register value initializing block 401 initializes the value of the register 402. Here, the initial value of the register is set to 0.

[0295] After that, the register value adding block 404 adds M to the value of the register 402 each time frame data is input.

[0296] The register value subtracting block 405 detects the register value thus incremented by the register value adding block 404 and, if the value is not smaller than N, then subtracts N from the register value and supplies a processing instruction to the image processing block 406. For the input moving image data, the image processing block 406 performs processing only on the frame data for which the processing instruction is supplied from the register value subtracting block 405.

[0297] If there occurs the possibility that the processing in the image processing block 406 may not be able to catch up with the input data, the number-of-processing-frames adjusting block 602 reduces the value M to be added by the register value adding block 404. Conversely, if there is sufficient time for processing, the value M(m) may be increased.

[0298] Whether there is sufficient time for processing in the image processing block 406 can be determined by processing buffer output after temporarily storing input data in a buffer, and by thereafter detecting the amount of data remaining unprocessed in the buffer.

[0299] If the amount of unprocessed input data shows a tendency to increase, the number of frames to be processed is reduced, and conversely, if the amount shows a tendency to decrease, the number of frames to be processed is increased; in this way, it becomes possible to make maximum use of the computing power.

[0300] It is also possible to reduce the buffer amount by making provision so that only frame data for which a processing instruction is issued is input to the buffer.

[0301] In this way, in the sixth embodiment, the number of frames to be actually processed can be dynamically adjusted according to the image processing load. This achieves optimum input processing for the computing power of the personal computer.

[0302] The fourth to sixth embodiments have been described for the case of m=M. For the case of m=−M, on the other hand, if provision is made so that the register value adding block 404 “adds N to the register value if the register value is not larger than 0”, then the operation is the same as that of the foregoing embodiments of the present invention. Further, the prescribed value T may be set to N+1 when m=M, and to −1 when m=−M. Furthermore, the register value adding block 404 may perform the register value addition and, at the same time, issue the processing instruction to the image processing block 406, or to issue the processing instruction to the image processing block 406 after performing the register value addition.

[0303] The first to third embodiments have been described by taking a video tape recorder as an example of the input source, but the embodiments are also applicable for any other media such as video disks or data accessible via the Internet or the like.

[0304] Likewise, the fourth to sixth embodiments have been described by taking a video tape recorder as an example of the input source, but the embodiments are also applicable, without losing their real time capabilities, for any other media such as video disks or data transmitted via broadcasting or via the Internet.

[0305] (Embodiment 7)

[0306]FIG. 7 is a block diagram showing the configuration of a data processing apparatus according to a seventh embodiment of the present invention.

[0307] The data processing apparatus of this embodiment assumes the case in which when playing back moving image data with audio or the like on a personal computer, for example, sample data conversion for converting the frequency of image and audio of digital format becomes necessary because of the constraints of hardware constituting the personal computer and other software, but this embodiment utilizes fundamentally the same concept as that described in connection with the foregoing fourth to sixth embodiments.

[0308] Unlike the foregoing embodiment which adjusts the number of frames to be processed, the present embodiment shows a configuration example that is applicable when converting the number of pixel samples forming one frame.

[0309] As shown in FIG. 7, the seventh embodiment comprises an input means 701, an initializing means 702, a first judging means 703, a first set value updating means 704, a Y[j] calculating means 705, a sample data output means 706, a second set value updating means 707, and a second judging means 708.

[0310]FIG. 8 is a flow chart illustrating the operation of the seventh embodiment.

[0311] In FIG. 8, reference numeral 801 is an initializing step, 802 is a first judging step, 803 is a sample data output step, 804 is a subtraction step, 805 is a second judging step, and 806 is an addition step.

[0312]FIG. 9 is an explanatory diagram for explaining in detail the operation of the seventh embodiment.

[0313] In the seventh embodiment, it is assumed that the number of samples, M, in the input sample data sequence X[i] is 300 and the number of samples, N, in the output sample data sequence Y[j] is 400. Further, a predetermined constant k is considered; in the seventh embodiment, the constant k is 1.

[0314] Referring to FIGS. 7 to 9, the operation of the seventh embodiment will be described below along with a data processing method constituting one embodiment of the present invention.

[0315] Here, the value of the i-th (0≦i≦M−1) sample in the input sample data sequence is denoted by X[i], and the value of the j-th (0≦j≦M−1) sample in the output sample data sequence is represented by Y[j].

[0316] In this case, the input means 701 first inputs the values of M, N, and the constant k. In the present embodiment, the input means 701 inputs M=300, N=400, and k=1.

[0317] Next, in the initializing step 801, the initializing means 702 sets an initial value for a prescribed parameter W and initial values for i and j, and also sets X[M]=X[M−1] for convenience of calculating the final output sample data Y[N−1]. In the present embodiment, W=400 (=k×N), i=0, j=0, and X[300]=X[299] are set.

[0318] The process then proceeds to the first judging step 802. In the first judging step 802, the first judging means 703 first judges whether the value of k input by the input means 701 is positive or negative. In this embodiment, the value is judged to be positive since k is 1.

[0319] Next, the first judging means 703 judges whether the parameter W is 0 or less or not. If the result of the judgement in the first judging step 802 is false, the process proceeds to the sample data output step 803; if the result of the judgement in the first judging step 802 is true, the process proceeds to the addition step 806. Since the value of W at this time is 400, the result of the judgement in the first judging step 802 is false, so that the process proceeds to the sample data output step 803.

[0320] After the first judging means 703 has judged whether the parameter W is 0 or less or not, when the constant k is positive, the first set value updating means 704 does not change the value of i if the parameter W is larger than 0, but changes the value of i to (i+1) and the value of the parameter W to (W+k×N) if the parameter W is 0 or less. Since, at this time, the parameter W is 400, the value of i is not changed.

[0321] Next, in the sample data output step 803, the Y[j] calculating means 705 calculates the zeroth sample data Y[0] in the output sample data sequence Y[j] in accordance with equation 1.

Y[j] ((k×N−W)×X[i+1]+W×X[i])/(k×N)  (Equation 1)

[0322] More specifically, Y[0] is calculated using equation 2.

Y[0]=((400−400)×X[1]+400×X[0])/400=X[0]  (Equation 2)

[0323] The sample data output means 706 then outputs Y[0] calculated by the Y[j] calculating means 705.

[0324] This Y[0] is the same as X[0], as shown by 901 in FIG. 3 [sic;9], meaning that X[0] is output unaltered as Y[0].

[0325] Next, in the subtraction step 804 which follows the calculation of Y[0] by the Y[j] calculating means 705, the second set value updating means 707 changes the value of the parameter W used for the calculation of Y[0] to (W−k×M) and also changes Y[0] to Y[1].

[0326] That is, in this case, in the subtraction step 804, W is changed to W=400−300=100 and j to j=0+1=1.

[0327] Next, in the second judging step 805, the second judging means 708 judges whether the value of j updated by the second set value updating means 707 is less than N, that is, less than 400 or not and, if the updated value of j is judged to be less than N, then allows the first judging means 703 to continue further processing; on the other hand, if the updated value of j is judged to be not smaller than N, the whole process is terminated. Since, at this point in time, the value of j updated by the second set value updating means 707 is 1, the second judging step 805 judges that j=1<400=N, and the process returns to the first judging step 802.

[0328] Next, in the first judging step 802, the first judging means 703 judges whether the parameter W updated by the second set value updating means 707 is 0 or less or not. Since the updated parameter W is 100, the result of the judgment is false, and the process proceeds to the sample data output step 803.

[0329] Next, in the sample data output step 803, the Y[j] calculating means 705 calculates the first sample data Y[1] in the output sample data sequence Y[j] in accordance with equation 1.

[0330] More specifically, Y[l] is calculated using equation 3.

Y[1]((400−100)×X[1]+100×X[0])/400=¾×X[1]+¼×X[0]  (Equation 3)

[0331] Then the sample data output means 706 outputs Y[1] calculated by the Y[j] calculating means 705.

[0332] This Y[1] is the weighted average of X[1] and X[0] with weights given in the ratio of 3:1, as shown by 902 in FIG. 9.

[0333] Next, in the subtraction step 804 which follows the calculation of Y[1] by the Y[j] calculating means 705, the second set value updating means 707 changes the value of the parameter W used for the calculation of Y[1] to (W−k×M) and also changes Y[1] to Y[2].

[0334] That is, in this case, in the subtraction step 804, W is changed to W=100−300=−200 and j to j=1+1=2.

[0335] Next, in the second judging step 805, the second judging means 708 judges whether the value of j updated by the second set value updating means 707 is less than N or not, as earlier described; since, at this point in time, the value of j updated by the second set value updating means 707 is 2, the second judging step 805 judges that j=2<400=N, and the process returns to the first judging step 802.

[0336] Next, in the first judging step 802, the first judging means 703 judges whether the parameter W updated by the second set value updating means 707 is 0 or less or not. Since the updated parameter W is −200, the result of the judgment is true, and the process proceeds to the addition step 806.

[0337] Then, in the addition step 806, since the parameter W is −200, the first set value updating means 704 changes the value of the parameter W to (W+k×N).

[0338] That is, the value of the parameter W is changed to −200+400=200. In the addition step 806, the first set value updating means 704 further changes the value of i thus far used to (i+1). That is, the value of i is changed from 0 to 1. After that, the process returns once again to the first judging step 802.

[0339] Next, in the first judging step 802, the first judging means 703 judges whether the parameter W updated by the first set value updating means 704 is 0 or less or not. Since the updated parameter W is 200, the result of the judgement is false, and the process proceeds to the sample data output step 803.

[0340] Next, in the sample data output step 803, the Y[j] calculating means 705 calculates the second sample data Y[2] in the output sample data sequence Y[j] in accordance with equation 1.

[0341] More specifically, Y[2] is calculated using equation 4.

Y[2]=((400−200)×X[1]+200×X[0])/400=½×X[2]+½×X[1]  (Equation 4)

[0342] Then the sample data output means 706 outputs Y[2] calculated by the Y[j] calculating means 705.

[0343] This Y[2] is the weighted average of X[2] and X[1] with weights given in the ratio of 1:1, as shown by 903 in FIG. 9.

[0344] After that, the above process is repeated to output the output sample data Y[j] sequentially. The final output sample data Y[399] is calculated in accordance with equation 5.

Y[399]=((400−300)×X[300]+300×X[299])/400=¼×X[300]+¾×X[299]  (Equation 5)

[0345] However, since X[300] does not actually exist, equation 5 cannot be calculated. Here, it should be noted that X[300]=X[299] has been set by the initializing means 2 in the initializing step 801; accordingly, equation 5 is calculated by replacing X[300] with X[299], and the result is Y[399]=X[299].

[0346] After outputting Y[399], j=400 is set in the subtraction step 804. In this case, the result of the judgement in the second judging step 805 is false, so that the process is terminated.

[0347] As described above, in the seventh embodiment, the conversion of sample data counts that becomes necessary for resolution conversion of image signals or frequency conversion of audio signals or the like can be accomplished with a smaller memory capacity and fewer calculation steps than would be needed in the prior art. Further, the weighted averaging performed in the sample data output step 803 has the same effect as low-pass filtering.

[0348] In the present embodiment, k×N is set as the initial value of W in the initializing step 801; this is to make the first input and output data match in phase by setting Y[0]=X[0]. Any value can be used as the initial value of W as long as the value satisfies the relation 0≦W≦k×N.

[0349] If k is negative, exactly the same thing can be accomplished by reversing the judgement condition in the first judging step 802.

[0350] (Embodiment 8)

[0351] Next, a data processing apparatus according to an eighth embodiment of the present invention will be described.

[0352] The configuration of this embodiment is the same as that of the foregoing seventh embodiment, and therefore the description thereof will not be repeated here.

[0353] Next, the operation of the eighth embodiment of the present invention will be described along with a data processing method constituting one embodiment of the present invention.

[0354] While the constant k was set to 1 in the seventh embodiment, in the present embodiment the value of k is set to {fraction (1/100)}. Further, the number of samples, M, in the input sample data sequence X[i] is set to 400 and the number of samples, N, in the output sample data sequence Y[j] to 300.

[0355] That is, the differences between the seventh and eighth embodiments are the number of samples, M, in the input sample data sequence X[i], the number of samples, N, in the output sample data sequence Y[j], and the value of the constant k.

[0356] More specifically, while the seventh embodiment concerned an example in which the number of samples was increased, the eighth embodiment concerns an example in which the number of samples is reduced, and k is set as the reciprocal of the least common multiple of M and N.

[0357] Referring to FIGS. 7, 8, and 10, the operation of the eighth embodiment will be described in detail below.

[0358] First, the input means 701 inputs the values of M, N, and the constant k. In the present embodiment, the input means 701 inputs M=400, N=300, and k={fraction (1/100)}.

[0359] Next, in the initializing step 801, the initializing means 702 sets an initial value for the prescribed parameter W and initial values for i and j, and also sets X[M]=X[M−1] for convenience of calculating the final output sample data Y[N−1]. In the present embodiment, W=3 (=k×N), i=0, j=0, and X[400]=X[399] are set.

[0360] The process then proceeds to the first judging step 802. In the first judging step 802, the first judging means 703 first judges whether the value of k input by the input means 701 is positive or negative. In the eighth embodiment, the value is judged to be positive since k is {fraction (1/100)}.

[0361] Next, the first judging means 703 judges whether the parameter W is 0 or less or not. If the result of the judgement in the first judging step 802 is false, the process proceeds to the sample data output step 803; if the result of the judgement in the first judging step 802 is true, the process proceeds to the addition step 806. Since the value of W at this time is 3, the result of the judgement in the first judging step 802 is false, so that the process proceeds to the sample data output step 803.

[0362] After the first judging means 703 has judged whether the parameter W is 0 or less or not, when the constant k is positive the first set value updating means 704 does not change the value of i if the parameter W is larger than 0, but changes the value of i to (i+1) and the value of the parameter W to (W+k×N) if the parameter W is 0 or less. Since, at this time, the parameter W is 3, the value of i is not changed.

[0363] Next, in the sample data output step 803, the Y[j] calculating means 705 calculates the zeroth sample data Y[0] in the output sample data sequence Y[j] in accordance with equation 1.

Y[j]=((k×N−W)×X[i+1]+W×X[i])/(k×N)  (Equation 1)

[0364] More specifically, Y[0] is calculated using equation 6.

Y[0]=((3−3)×X[1]+3×X[0])/3=X[0]  (Equation 6)

[0365] The sample data output means 706 then outputs Y[0] calculated by the Y[j] calculating means 705.

[0366] This Y[0] is the same as X[0], as shown by 1001 in FIG. 10, meaning that X[0] is output unaltered as Y[0].

[0367] Next, in the subtraction step 804 which follows the calculation of Y[0] by the Y[j] calculating means 705, the second set value updating means 707 changes the value of the parameter W used for the calculation of Y[0] to (W−k×M) and also changes Y[0] to Y[1].

[0368] That is, in this case, in the subtraction step 804, W is changed to W=3−4=−1 and j to j=0+1=1.

[0369] Next, in the second judging step 805, the second judging means 708 judges whether the value of j updated by the second set value updating means 707 is less than N, that is, less than 300 or not and, if the updated value of j is judged to be less than N, then allows the first judging means 703 to continue further processing; on the other hand, if the updated value of j is judged to be not smaller than N, the whole process is terminated. Since, at this point in time, the value of j updated by the second set value updating means 707 is 1, the second judging step 805 judges that j=1<300=N, and the process returns to the first judging step 802.

[0370] Next, in the first judging step 802, the first judging means 703 judges whether the parameter W updated by the second set value updating means 707 is 0 or less or not. Since the updated parameter W is −1, the result of the judgment is true, and the process proceeds to the addition step 806.

[0371] Then, in the addition step 806, since the parameter W is −1, the first set value updating means 704 changes the value of the parameter W to (W+k×N). That is, the value of the parameter W is changed to −1+3=2. In the addition step 806, the first set value updating means 704 further changes the value of i thus far used to (i+1).

[0372] That is, the value of i is changed from 0 to 1. After that, the process returns once again to the first judging step 802.

[0373] Next, in the first judging step 802, the first judging means 703 judges whether the parameter W updated by the first set value updating means 704 is 0 or less or not. Since the updated parameter W is 702, the result of the judgement is false, and the process proceeds to the sample data output step 803.

[0374] Next, in the sample data output step 803, the Y[j] calculating means 705 calculates the first sample data Y[1] in the output sample data sequence Y[j] in accordance with equation 1.

[0375] More specifically, Y[1] is calculated using equation 7.

Y[1]=((3−2)×X[2]+2×X[1])/3=⅓×X[2]+⅔×X[1]  (Equation 7)

[0376] Then the sample data output means 706 outputs Y[1] calculated by the Y[j] calculating means 705.

[0377] This Y[1] is the weighted average of X[2] and X[1] with weights given in the ratio of 1:2, as shown by 1002 in FIG. 10.

[0378] After that, by repeating the above process in the same manner as in the seventh embodiment until j=300 thereby making the result of the judgement in the second judging step 805 become false, 300 output sample data Y[0], Y[1], Y[2], . . . , Y[299] can be obtained.

[0379] With the sample data sequence conversion illustrated in the present embodiment, not only the conversion that involves increasing the number of sample data but also the conversion that involves reducing the number can be accomplished using the same algorithm.

[0380] Furthermore, in the present embodiment, by setting k={fraction (1/100)}, it becomes possible to reduce the necessary bit count of the parameter needed for the calculation of each Y[j] in the sample data output step 803. If k=1 as in the seventh embodiment, at least 9 bits are needed to hold W, k×N, and other values, and when describing in the C language, a short type or a long type variable becomes necessary. On the other hand, if k={fraction (1/100)}, only two bits are needed, and a char type variable is sufficient for the purpose.

[0381] Further, as in the seventh embodiment, any value that satisfies the relation 0≦W≦k×N can be chosen as the initial value of W, and if k is negative, exactly the same thing can be accomplished by reversing the judgement condition in the first judging step 802.

[0382] The seventh and eighth embodiments have each been described as calculating Y[j] using X[i] and X[i+1], but instead, each Y[j] may be calculated using three or more different X[i], for example, X[i], X[i+1], X[i+2], etc. Alternatively, each Y[j] may be calculated by multiplying, for example, the squares of X[i] and X[i+1] by a prescribed coefficient. In other words, each Y[j] maybe calculated using a linear function of a plurality of X[i] or a nonlinear function of a plurality of X[i].

[0383] (Embodiment 9)

[0384]FIG. 11 is a block diagram showing the configuration of a data processing apparatus according to a ninth embodiment of the present invention.

[0385] As shown in FIG. 11, in the ninth embodiment of the present invention, a dummy adding means 1101 is added to the configuration of the seventh embodiment described with reference to FIG. 7.

[0386]FIG. 12 shows a flow chart illustrating the operation of the ninth embodiment.

[0387] In FIG. 12, 1201 is an initializing step, 1202 is a first judging step, 1203 is a sample data output step, 1204 is a subtraction step, 1205 is a second judging step, 1206 is an addition step, and 1207 is a dummy adding step.

[0388] The initializing step 1201, the first judging step 1202, the sample data output step 1203, the subtraction step 1204, the second judging step 1205, and the addition step 1206 in FIG. 12 are substantially the same as the initializing step 801, the first judging step 802, the sample data output step 803, the subtraction step 804, the second judging step 805, and the addition step 806 in FIG. 8. Accordingly, FIG. 12 is the same as Figure which is substantially added the dummy adding step 1207 to each step in FIG. 8.

[0389] Referring to FIGS. 11 and 12, the operation of the ninth embodiment will be described in detail below, along with a data processing method constituting one embodiment of the present invention.

[0390] The present embodiment deals with the case in which an image data sequence X[i] comprising 400 pixels per line with three bytes per pixel is converted to an image data sequence Y[j] without changing the number of lines but by reducing the number of pixels per line to 375.

[0391] To simplify the explanation, the present embodiment assumes that both input and output consist of one line of pixel data.

[0392] It is also assumed that the output sample data sequence Y[j] is filled in a memory on a line by line basis without leaving gaps, and that the first data on each line must be aligned on a four byte boundary in order to correctly handle the data as a DIB (Device Independent Bitmaps) format.

[0393] The flow chart of FIG. 12 is applied by setting M=400, N=375, k=1, b=3, and p=4. Though the values of M and N are different from those in the seventh embodiment, in the ninth embodiment the operation is similar to that of the seventh embodiment. Here, b and p will be described later.

[0394] In the initializing step 1201, initial values are set for the necessary parameters. In the present embodiment, W is set to 375 (k×N), i to 0, j to 0, and X[400] to X[399].

[0395] Then, operation similar to that of the seventh and eighth embodiments is performed to sequentially output N=375 output sample data.

[0396] After the 375 output sample data have been output, when j=375 thereby making the result of the judgement in the second judging step 1205 become false, the process proceeds to the dummy adding step 1207.

[0397] An explanation will now be given of why the process proceeds to the dummy adding step 1207 when j=375 thereby making the result of the judgement in the second judging step 1205 become false.

[0398] When handling image data of the DIB format on the Windows, images cannot be output correctly unless the first data on each line is aligned on a four byte boundary. That the data is aligned on a p byte boundary means that the absolute address value of the data is a multiple of p.

[0399] For example, in a 24-bit RGB representation (a total of 24 bits per pixel, 8 bits each for red, green, and blue) which is a typical scheme in the DIB format, each pixel occupies an area of three bytes.

[0400] Accordingly, when an input data sequence is converted for each horizontal row to an output data sequence whose number of samples is not a multiple of 4, there is no guarantee that the first data on each line will be aligned on a four byte boundary, and the image may not be displayed correctly.

[0401] Therefore, the process proceeds to the dummy adding step 1207 so that the image will be displayed correctly even when the input data sequence is converted to an output data sequence whose number of samples is not a multiple of 4.

[0402] In the ninth embodiment, b=3 and p=4 are input at START in FIG. 12; here, b indicates the byte length of each sample in the output data sequence, and p means the byte boundary on which the first data in each output data sequence must be aligned.

[0403] Accordingly, the ninth embodiment will be described in detail by dealing with the case of b=3 and p=4.

[0404] In the present embodiment, since b=3 and N=375, b×N=1125 which is not a multiple of 4. This means that the first data in the output sample data sequence following the output sample data sequence of 375 samples would not be aligned on a four byte boundary. Here, in the dummy adding step 1207, the dummy adding means 1101 obtains L=1128 as a multiple of p=4 not smaller than 1125 and adds dummy data of L−b×N=3 bytes at the end of Y[374].

[0405] With the above operation, the 375 output sample data Y[0], Y[l], Y[2], . . . , Y[374] and the three dummy bytes can be output.

[0406] By repeating the above operation as many times as there are lines, an output pixel data sequence with the first data on each line aligned on a four byte boundary can be output. The image can thus be displayed correctly.

[0407] As described above, according to the present embodiment, data can be aligned on a desired byte boundary on an output-by-output basis. It thus becomes possible to enlarge or reduce image data of the DIB format to any desired size.

[0408] Further, as in the seventh and eighth embodiments, any value that satisfies the relation 0≦W≦k×N can be chosen as the initial value of W, and if k is negative, exactly the same thing can be accomplished by reversing the judgement condition in the first judging step 1202.

[0409] In the seventh to ninth embodiments, many variant forms of the embodiments can be generated by exchanging the addition in the addition step with the subtraction in the subtraction step and by changing the judgement condition in the first judging step.

[0410] This means that in FIG. 8, for example, the first equation in the addition step 806 may be changed to W=W−k×N and the first equation in the subtraction step 804 may be changed to W=W+k×N. If these changes are made, however, the judgement condition in the first judging step 802 must be changed to W≧0?.

[0411] (Embodiment 10)

[0412]FIG. 13 is a block diagram showing the configuration of a data processing apparatus according to a 10th embodiment of the present invention.

[0413] As shown in FIG. 13, the 10th embodiment of the present invention comprises a data input means 1301, a parameter input means 1302, a subtracting means 1303, a times W multiplying means 1304, an adding means 1305, and an output means 1306.

[0414]FIG. 14 shows a flow chart illustrating the operation of this embodiment. In FIG. 14, 1401 is a first load step, 1402 is a second load step, 1403 is a third load step, 1404 is a subtraction step, 1405 is a times W multiplying step, 1406 is an addition step, and 1407 is an output step.

[0415] The 10th embodiment of the present invention is used, for example, when generating a new number from two predetermined numbers, for example, in the sample data output step 803 in FIG. 8 of the seventh embodiment. Rearranging equation 1 in the sample data output step 803 in FIG. 8 yields equation 8 as shown below.

Y[j]=(1−w)×X[i+1]+w×X[i], w=W/(k×N)  (Equation 8)

[0416] Referring to FIGS. 13 and 14, the operation of the 10th embodiment will be described below along with a data processing method constituting one embodiment of the present invention.

[0417] First, the data input means 1301 inputs data of two predetermined numbers X1 and X2.

[0418] Then, the parameter input means 1302 inputs a parameter w for obtaining a number Y located at a position at which the distance between X1 and X2 is divided in a ratio of (1−w):w.

[0419] The numbers X1 and X2 and the parameter w are loaded into a register A, a register B, and a register C in the first load step 1401, the second load step 1402, and the third load step 1403, respectively.

[0420] Next, in the subtraction step 1404, the subtracting means 1303 subtracts the contents of the register B from the contents of the register A. After the subtraction, X1−X2 is held in the register A.

[0421] Next, in the times W multiplying step 1405, the times W multiplying means 1304 multiplies the contents of the register A by the contents of the register C. As a result, w×(X1−X2) is held in the register A.

[0422] Next, in the addition step 1406, the adding means 1305 adds the contents of the register B to the contents of the register A. After the addition, w×(X1−X2)+X2 is held in the register A.

[0423] Finally, in the output step 1407, the output means 1306 outputs the result Y obtained by the adding means 1305. The result is expressed by equation 9.

Y=w×(X1−X2)+X2=w×X1+(1−w)×X2  (Equation 9)

[0424] In the present embodiment, the operations necessary for obtaining one number Y are three load operations, two add/subtract operations, and a multiplication. Compared with the prior art example shown in FIG. 18, the number of load operations is reduced by one and the number of multiplications is also reduced by one. Furthermore, since computers usually require more clocks for multiplication operations than for subtract/add operations and load, reducing the number of multiplications by one for each output of Y (output value) offers the great effect of reducing the overall processing time.

[0425] As described above, according to the embodiment of the present invention, when weighted average calculations that occur frequently in filtering operations are performed by a computer, the number of multiplications can be reduced by one for each output sample, thus serving to greatly reduce the overall processing time.

[0426] Further, in the times W multiplying step of the present embodiment, if w is the reciprocal of a power of two, the multiplication operation can be replaced by a shift operation; this further increases the speed of operation.

[0427] Accordingly, when the configuration example of this embodiment is applied to the calculation processing described in connection with the foregoing embodiments, a further faster operating speed can be achieved.

[0428] (Embodiment 11)

[0429]FIG. 15 is a block diagram showing the configuration of a data processing apparatus according to an 11th embodiment of the present invention.

[0430] As shown in FIG. 15, the 11th embodiment of the present invention comprises an input means 1501, an initializing means 1502, a times W multiplying means 1503, a bit shift means 1504, a sample data output means 1505, a set value updating means 1506, and a judging means 1507.

[0431]FIG. 16 is a flow chart illustrating the operation of the 11th embodiment.

[0432] In FIG. 16, 1601 is an initializing step, 1602 is a times w multiplying step, 1603 is a bit shift step, 1604 is a sample data output step, and 1605 is a judging step.

[0433] The 11th embodiment of the present invention is used, for example, when performing many divisions using the same constant, for example, in the sample data output step 803 in FIG. 8 of the seventh embodiment. Rearranging equation 1 in the sample data output step 803 in FIG. 8 yields equation 10 as shown below.

Y=X/(k×N), X=(k×N−W)×X[i+1]+W×X[i]  (Equation 10)

[0434] Performing many divisions such as shown in equation 10 imposes a great burden on the PC. In the 11th embodiment of the present invention, a method that can reduce the overall amount of computation involving many divisions will be described with reference to FIGS. 15 and 16. In the present embodiment, the number of input sample sequences X[i] is denoted by N. Further, samples in an output sample sequence Y[i], after the division, that correspond to the respective samples X[i] in the input sample sequence X[i] are each denoted by Y[i].

[0435] First, the input means 1501 inputs the value representing N as the number of input sample sequences X[i], a prescribed value of Q, and a prescribed natural number k.

[0436] Next, in the initializing step 1601, the initializing means 1502 sets 0 as the initial value of i, and a prescribed coefficient w that satisfies equation 11, and the process proceeds to the times w multiplying step 1602.

w=(2{circumflex over ( )}k)/Q  (Equation 11)

[0437] where {circumflex over ( )}k means raising to the power k.

[0438] Next, in the times w multiplying step 1602, the times w multiplying means 1503 calculates w X X[0] using the input sample data X[0] and the W set in the initializing step 1601, and sets the result as Z[0].

[0439] Then, in the bit shift step 1603, the bit shift means 1504 shifts Z[0] by k bits in the low order direction by regarding Z[0] as a binary number. The k here means the k input by the input means 1501.

[0440] Next, in the sample data output step 1604, the sample data output means 1505 outputs the Z[0] shifted in the bit shift step 1603 as Y[0], and in the same sample data output step 1604, the set value updating means 1506 adds 1 to i and thus sets i to 1, after which the process proceeds to the judging step 1605.

[0441] In the judging step 1605, since i=1, the judging means 1507 judges the result to be true, and the process returns to the times w multiplying step 1602.

[0442] The above process is repeated until i=N, and when the result is judged to be false in the judging step 1605, the operation of the present embodiment is terminated.

[0443] In the prior art example, the number of necessary divisions was N. By contrast, in the present embodiment, the division is performed only once in the initializing step 1601, irrespective of the value of N. Generally, when performing a division in a computer, a much larger number of clocks are required than when performing a multiplication, not to speak of when performing add/subtract or shift operations. According to the present embodiment, therefore, by drastically reducing the number of divisions compared with the prior art example, the processing time can be reduced significantly.

[0444] Here, the value of k can be set arbitrarily according to the output resolution or the bit count of the register used; for example, when using a 32-bit register, it is preferable to set k=16.

[0445] As described above, according to the seventh and eighth embodiments of the present invention, the conversion from input sample data having an arbitrary number of samples, M, to an arbitrary number of output samples, N, can be performed at high speed.

[0446] Furthermore, by adding dummy data at the end of the output sample data, as described in the ninth embodiment, the first data on each line of an image can always be aligned on a four byte boundary, facilitating image size conversion to any desired size.

[0447] Moreover, by using the method of obtaining a weighted average as described in the 10th embodiment and the method of dividing the input data sequence by a common divisor as described in the 11th embodiment, the sample data conversion in the seventh to ninth embodiments can be performed at faster speed.

[0448] In the seventh to 11th embodiments, when NIM≦½, there occurs input sample data that is not referenced when generating output sample data. In that case, distortion due to aliasing may occur in those embodiments. A possible method for solving this deficiency is to change the initial value of the parameter W in the initializing step or to calculate Y[j] in the sample data output step from not only X[i+1] and X[i] but also many more input sample data.

[0449] Further, in the first to 11th embodiments, the same effects as described in connection with the respective embodiments can also be obtained by creating a program recording medium, such as a magnetic disk or an optical disk, that holds recorded thereon a program for having a computer implement all or part of the functions of the data processing method and all or part of the constituent elements of the data processing apparatus, and by operating the computer using the same.

[0450] It is also possible to transfer the software describing the present invention to another computer via a recording medium or a transmission medium, and to implement the calculation method of the present invention on that computer.

[0451] In the present invention, various other configurations than those described in the embodiments are possible and can be implemented in either hardware or software. Furthermore, the various inventions described above can be used in combination.

INDUSTRIAL APPLICABILITY

[0452] According to the present invention, if image processing cannot catch up with the input, the image data is re-input for processing by utilizing information concerning the recorded position, the recorded time, or the time at which playback is to be performed; this achieves the same effect as processing continuous moving image data without interruption.

[0453] Furthermore, by just using registers and performing addition and subtraction operations on the contents of the registers on a frame by frame basis, the processing can be decimated into a desired number of frames and also, the number of frames to be actually processed can be adjusted dynamically according to the image processing load.

[0454] Moreover, according to the present invention, input data having an arbitrary number of samples can be converted to data having an arbitrary number of samples for output. Furthermore, a large capacity memory for holding upsampled data and the computation necessary for both upsampling and decimation as shown by the prior art can be accomplished with a much smaller amount of computation. 

1-24. (Canceled).
 25. A data processing method for converting an input sample data sequence consisting of M samples to an output sample data sequence consisting of N samples, comprising: an initial value setting step for setting a nonzero constant k and a prescribed parameter W; a sequential addition step for repeating an operation to add k*N to said parameter W by sequentially scanning input sample data as long as W≦0 when k>0 or as long as W≧0 when k<0; a sample data output step for outputting said converted output sample data when W becomes larger than 0 in the case of k>0 or W becomes smaller than 0 in the case of k>0 in said sequential addition step; and a subtraction step for subtracting k*M from said W, wherein said sequential addition step, said sample data output step, and said subtraction step are repeated until said N output sample data have been output.
 26. A data processing method according to claim 25, wherein when each sample data in said output sample data sequence has a byte length represented by a prescribed constant b, and an overall byte length of said output sample data sequence is not an integral multiple of a prescribed constant p, there is further included a dummy adding step for adding dummy data of L−b*N bytes at end of said output sample data sequence of N samples, where L is a multiple of p not smaller than b*N, and said output sample data sequence of N samples is output together with said dummy data.
 27. A data processing method according to claim 25, wherein said k is
 1. 28. A data processing method according to claim 25, wherein said k is the reciprocal of the greatest common measure of said M and said N.
 29. A data processing method comprising: a data input step for inputting data of two predetermined numbers X1 and X2; a parameter input step for inputting a parameter w for obtaining a number Y located at a position at which the distance between said X1 and said X2 is divided in a ratio of (1−w):w; a subtraction step for generating X3 by subtracting said X2 from said X1; a times w multiplying step for generating X4 by multiplying the X3 obtained in said subtraction step by said parameter w; an addition step for generating Y by adding said X2 to the X4 obtained in said times w multiplying step; and an output step for outputting said Y obtained in said addition step.
 30. A data processing method for inputting N data sequences X[i] [sic; for inputting data sequence X[i] including N data], and for outputting as Y[i] a value obtained by dividing said X[i] by a constant Q, comprising: an initializing step for obtaining a coefficient w=2{circumflex over ( )}k/Q (where {circumflex over ( )}k means raising to the power k) for an integer k larger than 0; a times w multiplying step for obtaining w*X[i] using said X[i] and said coefficient w obtained in said initializing step, and for taking said obtained w*X[i] as a new X[i]; and a bit shift step for taking as Y[i] a value obtained by shifting the X[i] obtained in said times w multiplying step by k bits in a low order bit direction when said X[i] is expressed in bit representation, wherein said times w multiplying step and said bit shift step are repeated N times to sequentially output N data sequences Y[i] [sic; to sequentially output data sequence Y[i] including N data].
 31. A data processing apparatus for converting an input sample data sequence consisting of M samples to an output sample data sequence consisting of N samples, comprising: initial value setting means for setting a nonzero constant k and a prescribed parameter W; sequential adding means for repeating an operation to add k*N to said parameter W by sequentially scanning input sample data as long as W≦0 when k>0 or as long as W≧0 when k<0; sample data output means for outputting said converted output sample data when W becomes larger than 0 in the case of k>0 or W becomes smaller than 0 in the case of k<0 by said sequential adding means; and subtracting means for subtracting k*M from said W, wherein said sequential adding means, said sample data output means, and said subtracting means are operated in sequence repeatedly until said N output sample data have been output.
 32. A data processing apparatus according to claim 31, wherein when each sample data in said output sample data sequence has a byte length represented by a prescribed constant b, and an overall byte length of said output sample data sequence is not an integral multiple of a prescribed constant p, there is further included a dummy adding means for adding dummy data of L−b*N bytes at end of said output sample data sequence of N samples, where L is a multiple of p not smaller than b*N, and said output sample data sequence of N samples is output together with said dummy data.
 33. A data processing apparatus according to claim 31, wherein said k is
 1. 34. A data processing apparatus according to claim 31, wherein said k is the reciprocal of the greatest common measure of said M and said N.
 35. A data processing apparatus comprising: data input means for inputting data of two predetermined numbers X1 and X2; parameter input means for inputting a parameter w for obtaining a number Y located at a position at which the distance between said X1 and said X2 is divided in a ratio of (1−w):w; subtracting means for generating X3 by subtracting said X2 from said X1; times w multiplying means for generating X4 by multiplying the X3 obtained by said subtracting means by said parameter w; adding means for generating Y by adding said X2 to the X4 obtained by said times w multiplying means; and output means for outputting said Y obtained by said adding means.
 36. A data processing apparatus for inputting N data sequences X[i] [sic; for inputting data sequence X[i] including N data], and for outputting as Y[i] a value obtained by dividing said X[i] by a constant Q, comprising: initializing means for obtaining a coefficient w=2{circumflex over ( )}k/Q (where {circumflex over ( )}k means raising to the power k) for an integer k larger than 0; times w multiplying means for obtaining w*X[i] using said X[i] and said coefficient w obtained by said initializing means, and for taking said obtained w*X[i] as a new X[i]; and bit shift means for taking as Y[i] a value obtained by shifting the X[i] obtained by said times w multiplying means by k bits in a low order bit direction when said X[i] is expressed in bit representation, wherein said times w multiplying means and said bit shift means are operated in sequence N times to sequentially output N data sequences Y[i] [sic; to sequentially output data sequence Y[i] including N data]. 37-38. (Canceled) 